package com.t174.car.service.impl;

import com.t174.car.dao.PermissionDao;
import com.t174.car.entity.Permission;
import com.t174.car.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
@Service
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    private PermissionDao permissionDao;
    @Override
    public List<Permission> query(int uid) {
        List<Permission> list = permissionDao.query(0,uid);
        for (Permission permission:list){
            //二级菜单
            permission.setPermissionList(permissionDao.query(permission.getId(),uid));
        }
        return list;
    }

}
